﻿using CPPEI.ETL.DataServiceInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.ETL.ExtDSTest
{
    public class Class1 : IExtDSAdapter
    {
        public List<TDataSource> EnumerateSources()
        {
            List<TDataSource> sources = new List<TDataSource>();
            for (int index = 0; index < 4; index++)
            {
                TDataSource source = new TDataSource();
                source.Name = string.Format("source{0}", index);
                source.Value = string.Format("source{0}", index);

                for (int pIndex = 0; pIndex < 4; pIndex++)
                {
                    TDataSourceParameter param = new TDataSourceParameter(string.Format("c{0}", pIndex), typeof(string), string.Format("des_c{0}", pIndex));
                    source.Parameters.Add(param);
                }

                for (int cIndex = 0; cIndex < 4; cIndex++)
                {
                    TDataSourceColumn col = new TDataSourceColumn(string.Format("c{0}", cIndex), typeof(string));
                    source.Columns.Add(col);
                }

                sources.Add(source);
            }
            return sources;
        }

        public System.Data.DataTable GetData(DataSourceInfo dataSourceInfo, Dictionary<string, object> dataDict)
        {
            throw new NotImplementedException();
        }
    }
}
